File Sizes Explained
File size measures the size of a computer file and is typically measured in bytes with a prefix. The smallest unit in computers is bit and comes from binary digit. A bit has only two digits - zero and one. The zero is also known as false (off) state and the one is known as true (on).
The bits are combined in groups in order to form larger units. The next unit larger than the bit is the byte which is formed by the combination of eight bits and can represent a value from 0 to 255 which is 2 to the power of 8 - all the possible combinations of the 8 bits that it includes.
The next larger units after the byte are named kilobyte, megabyte, gigabyte, terabyte and so on which lead to great deal of confusion. Though the kilo prefix in the metric system means 1000 (e.g. grams) in computers it means 1024 (e.g. bytes). In order to correct this mess the International Electrotechnical Commission (IEC) approved a new IEC International Standard in December 1998. You can find the list of IEC metric and binary names in the table at the end of this article.
How to Convert File Sizes
As already described the smallest unit in computers is the bit. Converting file sizes is similar to converting other units with some small differences.
To convert bits to bytes you have to divide the count of bits to eight as one byte contains 8 bits. To further convert the bytes to kilobytes you have to divide the value by 1024. To convert from kilobytes to megabytes you have to divide the kilobytes to 1024 again and so on. This is a bit different than in metric system where values are divided by 1000 to convert them to the next larger unit. For example 1 km is 1000 meters.
Why 1 Megabyte is 1024 Kilobytes Instead of 1000 Kilobytes?
Where does the 1024 number come from? Well most numbers in computers are 2 to the power of X, and 1024 is 2 to the power of 10. That is because computers use the binary system - not the decimal. Of course you can represent the decimal or any other system on a computer, but at its core hardware level the computer uses the binary system. In 1998 IEC introduced new naming convention for the file sizes which now creates even more confusion. If you were using computers for a long time you may think that a megabyte is still 1024 kilobytes, but that is no longer the case.
Megabyte is now 1000 kilobytes which on the other hand is one thousand bytes. The old multiples of 1024 units are now with new prefixes and mebibyte is 1024 kibibytes and a kibibyte is 1024 bytes. Changing something existing and well established and known by billions of people in my opinion is not a good idea, but it is my own personal position. It would be much less confusing to use new unit names, but that would not correspond to the metric system naming convention. There was no perfect solution so we have to get used to it.
If you are purchasing a storage device you can see that a 2TB hard drives displays as 1.82 TB which is much smaller in Windows. Windows still uses the old unit naming convention which causes the discrepancy. Of course the new naming convention is very welcome for the storage manufacturers as they now provide 10% less storage while using the same naming convention. So bear in ming that when purchasing a new hard drive or memory card.
Example
File Size Basics - Common File Sizes
If you are new to computers and files here are several samples of common file formats (types) and their average sizes:
- Text File (TXT) - Text files are one of the smallest file types. Their sizes are equal to the count of characters they contain. A few pages text file is typically 1-2 KB. These are considered "TINY" files.
- Word documents (DOC, DOCX) - These files contain styling and formatting and are quite larger. A few pages DOC file without images is about 50-300KB. these are considered "SMALL" files.
- A photo (JPG) from a common 12 MPX camera is about 3-5 MB. These are considered "MEDIUM" size.
- MP3 Audio File - a full length song is between 3 and 10 MB depending on its duration and quality (compression). The other compressed audio files are also in this range - MP4, FLAC, OGG etc. Uncompressed WAV files used in CDs are very large. They are about 10 MB per minute - e.g. about 70 MB for a 7 minutes song.
- A 10 second low resolution 640X480 AVI video is about 15 MB - This size leans towards "LARGE".
- A 1-1.5 hour video with a lower SD resolution is about 700-1000MB This is considered a "LARGE" file.
- A 1-1.5 hour video with FULL HD quality is about 7-10GB depending on the codec (compression) that is used to store it.
Name (Base 10) | Size (Base 10) | Name (Base 2) | Size (Base 2) |
---|---|---|---|
kilobyte (kB) | 103 | kibibyte (KiB) | 210 |
megabyte (MB) | 106 | mebibyte (MiB) | 220 |
gigabyte (GB) | 109 | gibibyte (GiB) | 230 |
terabyte (TB) | 1012 | tebibyte (TiB) | 240 |
petabyte (PB) | 1015 | pebibyte (PiB) | 250 |
exabyte (EB) | 1018 | exbibyte (EiB) | 260 |
zettabyte (ZB) | 1021 | zebibyte (ZiB) | 270 |
yottabyte (YB) | 1024 | yobibyte (YiB) | 280 |